<?php
/**
 * 用户参与明细模块
 * User:LLW
 * Date:2020-04-07
 * Time:15:53
 */

namespace app\caidongweb\model;

class RaiseUserModel extends BaseModel
{
    protected $table = 'cd_raise_user';

    /**
     * 参与用户首页
     * @return \think\Paginator
     */
    public function getList()
    {
        $where = [];
        input('key') ? $where[input('city')] = input('key') : false;
        $sta = strtotime(input('sta'));
        $end = strtotime(input('end'));
        if($sta && $end){
            $where['ru_time'] = array('between',"$sta,$end");
        }
        $list = $this->alias('r')
            ->join('cd_raise e','r.ru_raid=e.ra_id')
            ->where($where)->order('ru_time desc')
            ->field('r.*,e.ra_nper')
            ->paginate(50,false,['query'=>request()->param()]);
        return $list;
    }
}